<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="../skin/pub/css/font-awesome.min.css">
    <link rel="stylesheet" href="../skin/pub/css/bootstrap.css">
    <link rel="stylesheet" href="../skin/css/examinations.css">
    <style type="text/css">
        body {
            padding-top: 40px;
            padding-bottom: 40px;
            background-color: #f5f5f5;
        }

        .form-signin {
            max-width: 300px;
            padding: 19px 29px 29px;
            margin: 20px auto 20px auto;
            background-color: #fff;
            border: 1px solid #e5e5e5;
            -webkit-border-radius: 5px;
            -moz-border-radius: 5px;
            border-radius: 5px;
            -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
            -moz-box-shadow: 0 1px 2px rgba(0,0,0,.05);
            box-shadow: 0 1px 2px rgba(0,0,0,.05);
        }
        .form-signin .form-signin-heading,
        .form-signin .checkbox {
            margin-bottom: 10px;
        }
        .form-signin input[type="text"],
        .form-signin input[type="password"] {
            font-size: 16px;
            height: auto;
            margin-bottom: 15px;
            padding: 7px 9px;
        }

    </style>
    <title>精准测评</title>
</head>
<body>
<div class="container-fluid">
    <div class="navbar-header">
        <a class="navbar-brand" href="#">
            <img alt="X+" src="../skin/img/logo.png">
        </a>
        <!--<p class="navbar-text navbar-right">Signed in as <a href="#" class="navbar-link">Mark Otto</a></p>-->
    </div>
</div>
<div class="container-fluid">
    <div class="container-fluid examinations">
        <div class="container">
            <div class="form-signin">
                <input type="text" class="input-block-level" placeholder="用户名">
                <input type="password" class="input-block-level" placeholder="密码">
                <button id="login" class="btn btn-large btn-primary" type="submit">登陆</button>
            </div>

        </div>
    </div>
</div>
<script src="../skin/pub/js/jquery-1.11.3.min.js"></script>
<script>
    //写cookies
    function setCookie(c_name, value, expiredays){
        var exdate=new Date();
        exdate.setDate(exdate.getDate() + expiredays);
        document.cookie=c_name+ "=" + escape(value) + ((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
    }

    //读取cookies
    function getCookie(name)
    {
        var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");

        if(arr=document.cookie.match(reg))

            return (arr[2]);
        else
            return null;
    }

    //删除cookies
    function delCookie(name)
    {
        var exp = new Date();
        exp.setTime(exp.getTime() - 1);
        var cval=getCookie(name);
        if(cval!=null)
            document.cookie= name + "="+cval+";expires="+exp.toGMTString();
    }

    $("#login").click(function (){
        //使用示例
        setCookie("user_id","linxiao",1);
        setCookie('username','Darren',1);
        alert(getCookie("username"));
        window.open("index.html","_self");
    })
</script>
</body>
</html>